package net.domain;

public class Person {
    public int age;
    public String name;

    public Person() {
    }

    public Person(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

   /* //比较
    @Override
    public int compareTo(Object o) {
        Person p = (Person) o;
        //return this.age - p.age;
        return this.name.compareTo(p.name);
        //return 0;
    }*/
}
